﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Legazpi.Payroll.Web.Utils;

namespace Legazpi.Payroll.Web.Admin.Reports
{
    public partial class EmployeePayslipsReport : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                var source = new Microsoft.Reporting.WebForms.ReportDataSource("dsEmployeePayslips", new ReportHelper().GetEmployeePayslips());

                ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;

                ReportViewer1.LocalReport.ReportPath = @"Rdlc\EmployeePayslipList.rdlc";
                ReportViewer1.LocalReport.DataSources.Clear();
                ReportViewer1.LocalReport.DataSources.Add(source);
                ReportViewer1.LocalReport.Refresh();
            }
        }
    }
}